package service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class MusicService extends Service {

    private MusicHelper musicHelper=null;

    private Log log;

//    public MusicService() {
//    }

    @Override
    public void onCreate(){
        log.d("MusicService------","onCreate");
        super.onCreate();
        musicHelper=new MusicHelper(this);
    }

    @Override
    public void onDestroy(){

        log.d("MusicService-------","onDestroy");
        super.onDestroy();
        musicHelper.destroy();
        musicHelper=null;

    }

    @Override
    public int onStartCommand(Intent intent,int flags,int starId){
        musicHelper.play();
        log.d("MusicService------","onStartCommand");
        return super.onStartCommand(intent,flags,starId);
    }


    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("Not yet implemented");
    }


}